home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 13 / Hobby PC 13.iso / assets / Asset Library / Forms / validate.txt < prev    next >
Text File  |  2001-04-09  |  1KB  |  41 lines

  1. <SCRIPT LANGUAGE="JavaScript" ID="sqValidate"><!--
  2. function validate(theForm)
  3.     {
  4.     var formTest = true;
  5.     if (checkName(theForm.fname) != true) {formTest = false};
  6.     if (checkName(theForm.initial) != true) {formTest = false};
  7.     if (checkName(theForm.lname) != true) {formTest = false};
  8.     if (checkAddress(theForm.addr) != true) {formTest = false};
  9.  
  10.     if (theForm.country == "")
  11.   {
  12.   formTest = false;
  13.   }
  14.  
  15.     if (theForm.country == "Canada")
  16.         {
  17.         if (checkPostalCode(theForm.pcode) != true) formTest = false;
  18.         if (checkUSPhone(theForm.phone) != true) formTest = false;
  19.         if (checkProvinceCode(theForm.state) != true) formTest = false;
  20.         }
  21.  
  22.     if (theForm.country == "USA")
  23.         {
  24.         if (checkZIPCode(theForm.pcode) != true) formTest = false;
  25.         if (checkStateCode(theForm.state) != true) formTest = false;
  26.         if (checkUSPhone(theForm.phone) != true) formTest = false;
  27.         }
  28.  
  29.     if (theForm.country == "Int")
  30.         {
  31.         if (checkInternationalPhone(theForm.phone) != true) formTest = false;
  32.         }
  33.  
  34.     if (checkEmail(theForm.email) != true) {formTest = false};
  35.     if (checkURL(theForm.url) != true) {formTest = false};
  36.     if (checkDate(theForm.year, theForm.month, theForm.day, "birthday") != true) {formTest = false};
  37.     if (checkCreditCard(theForm.cctype,theForm.cc) != true) {formTest = false};
  38.     return (formTest);
  39.     }
  40. // -->
  41. </SCRIPT>